home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 429_01 / chess12 / player.hpp < prev    next >
C/C++ Source or Header  |  1994-03-30  |  465b  |  25 lines

  1. #if !defined(PLAYER_HPP)
  2. #define PLAYER_HPP
  3.  
  4. #include "chess.hpp"
  5.  
  6. enum GAMESTATUS { GAMECONTINUE, GAMEOVER };
  7.  
  8. // abstract base class for player.  a player performs a move
  9. // when the play member is invoked.
  10. class PLAYER
  11.   {
  12.   private:
  13.     const PIECECOLOR color;
  14.  
  15.   public:
  16.     PLAYER(PIECECOLOR c) : color(c) { }
  17.  
  18.     PIECECOLOR whatColor(void) const { return(color); }
  19.  
  20.     virtual GAMESTATUS play(BOARD &board) const = 0;
  21.  
  22.   };
  23.  
  24. #endif
  25.